package com.jeecg.o2o.bGoods.entity;

import java.io.UnsupportedEncodingException;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.jeecgframework.poi.excel.annotation.Excel;

/**
 * @Title: Entity
 * @Description: 商品表
 * @author onlineGenerator
 * @date 2019-02-22 20:05:37
 * @version V1.0
 *
 */
@Entity
@Table(name = "bGoods", schema = "")
@SuppressWarnings("serial")
public class BgoodsEntity implements java.io.Serializable {
	/** 主键 */
	private java.lang.Integer id;
	/** 商品名 */
	@Excel(name = "商品名", width = 15)
	private java.lang.String name;
	/** 种类 */
	@Excel(name = "种类", width = 15)
	private java.lang.String categoriesid;
	/** 创建日期 */
	@Excel(name = "创建日期", width = 15, format = "yyyy-MM-dd")
	private java.util.Date createdate;
	/** 状态 */
	@Excel(name = "状态", width = 15)
	private java.lang.String status;
	/** 商品图文描述 */
	@Excel(name = "商品图文描述", width = 15)
	private byte[] described;
	private String describedStr;
	/** 价格 */
	@Excel(name = "价格", width = 15)
	private java.lang.Double price;
	/** 优惠价格 */
	@Excel(name = "优惠价格", width = 15)
	private java.lang.Double discountprice;
	/** 上架日期时间 */
	@Excel(name = "上架日期时间", width = 15, format = "yyyy-MM-dd")
	private java.util.Date onsaletime;
	/** 是否推荐 */
	@Excel(name = "是否推荐", width = 15)
	private java.lang.Integer iscommend;

	@Excel(name = "商品头图片", width = 15)
	private java.lang.Integer goodimg;

	@Transient
	private byte[] goodimgcode;

	@Transient
	private int num;// 购买数量，界面显示

	/**
	 * 方法: 取得java.lang.Integer
	 * 
	 * @return: java.lang.Integer 主键
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)

	@Column(name = "ID", nullable = false, length = 20)
	public java.lang.Integer getId() {
		return this.id;
	}

	/**
	 * 方法: 设置java.lang.Integer
	 * 
	 * @param: java.lang.Integer
	 *             主键
	 */
	public void setId(java.lang.Integer id) {
		this.id = id;
	}

	/**
	 * 方法: 取得java.lang.String
	 * 
	 * @return: java.lang.String 商品名
	 */

	@Column(name = "NAME", nullable = true, length = 50)
	public java.lang.String getName() {
		return this.name;
	}

	/**
	 * 方法: 设置java.lang.String
	 * 
	 * @param: java.lang.String
	 *             商品名
	 */
	public void setName(java.lang.String name) {
		this.name = name;
	}

	/**
	 * 方法: 取得java.lang.String
	 * 
	 * @return: java.lang.String 种类
	 */

	@Column(name = "CATEGORIESID", nullable = true, length = 50)
	public java.lang.String getCategoriesid() {
		return this.categoriesid;
	}

	/**
	 * 方法: 设置java.lang.String
	 * 
	 * @param: java.lang.String
	 *             种类
	 */
	public void setCategoriesid(java.lang.String categoriesid) {
		this.categoriesid = categoriesid;
	}

	/**
	 * 方法: 取得java.util.Date
	 * 
	 * @return: java.util.Date 创建日期
	 */

	@Column(name = "CREATEDATE", nullable = true, length = 20)
	public java.util.Date getCreatedate() {
		return this.createdate;
	}

	/**
	 * 方法: 设置java.util.Date
	 * 
	 * @param: java.util.Date
	 *             创建日期
	 */
	public void setCreatedate(java.util.Date createdate) {
		this.createdate = createdate;
	}

	/**
	 * 方法: 取得java.lang.String
	 * 
	 * @return: java.lang.String 状态
	 */

	@Column(name = "STATUS", nullable = true, length = 6)
	public java.lang.String getStatus() {
		return this.status;
	}

	/**
	 * 方法: 设置java.lang.String
	 * 
	 * @param: java.lang.String
	 *             状态
	 */
	public void setStatus(java.lang.String status) {
		this.status = status;
	}

	/**
	 * 方法: 取得java.sql.Blob
	 * 
	 * @return: java.sql.Blob 商品图文描述
	 */

	@Column(name = "DESCRIBED", nullable = true)
	public byte[] getDescribed() {
		return this.described;
	}

	/**
	 * 方法: 设置java.sql.Blob
	 * 
	 * @param: java.sql.Blob
	 *             商品图文描述
	 */
	public void setDescribed(byte[] described) {
		this.described = described;
	}

	/**
	 * 方法: 取得java.sql.Blob
	 * 
	 * @return: java.sql.Blob 商品图文描述
	 */
	@Transient
	public String getDescribedStr() {
		if (this.described != null) {
			try {
				this.describedStr = new String(this.described, "utf-8");
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
		}
		return describedStr;
	}

	/**
	 * 方法: 设置java.sql.Blob
	 * 
	 * @param: java.sql.Blob
	 *             商品图文描述
	 */
	public void setDescribedStr(String describedStr) {
		this.describedStr = describedStr;
	}

	/**
	 * 方法: 取得java.lang.Double
	 * 
	 * @return: java.lang.Double 价格
	 */

	@Column(name = "PRICE", nullable = true, length = 32)
	public java.lang.Double getPrice() {
		return this.price;
	}

	/**
	 * 方法: 设置java.lang.Double
	 * 
	 * @param: java.lang.Double
	 *             价格
	 */
	public void setPrice(java.lang.Double price) {
		this.price = price;
	}

	/**
	 * 方法: 取得java.lang.Double
	 * 
	 * @return: java.lang.Double 优惠价格
	 */

	@Column(name = "DISCOUNTPRICE", nullable = true, length = 32)
	public java.lang.Double getDiscountprice() {
		return this.discountprice;
	}

	/**
	 * 方法: 设置java.lang.Double
	 * 
	 * @param: java.lang.Double
	 *             优惠价格
	 */
	public void setDiscountprice(java.lang.Double discountprice) {
		this.discountprice = discountprice;
	}

	/**
	 * 方法: 取得java.util.Date
	 * 
	 * @return: java.util.Date 上架日期时间
	 */

	@Column(name = "ONSALETIME", nullable = true, length = 32)
	public java.util.Date getOnsaletime() {
		return this.onsaletime;
	}

	/**
	 * 方法: 设置java.util.Date
	 * 
	 * @param: java.util.Date
	 *             上架日期时间
	 */
	public void setOnsaletime(java.util.Date onsaletime) {
		this.onsaletime = onsaletime;
	}

	/**
	 * 方法: 取得java.lang.Integer
	 * 
	 * @return: java.lang.Integer 是否推荐
	 */

	@Column(name = "ISCOMMEND", nullable = true, length = 32)
	public java.lang.Integer getIscommend() {
		return this.iscommend;
	}

	/**
	 * 方法: 设置java.lang.Integer
	 * 
	 * @param: java.lang.Integer
	 *             是否推荐
	 */
	public void setIscommend(java.lang.Integer iscommend) {
		this.iscommend = iscommend;
	}

	/**
	 * 方法: 取得java.lang.Integer
	 * 
	 * @return: java.lang.Integer 商品头图片
	 */

	@Column(name = "GOODIMG", nullable = true, length = 32)
	public java.lang.Integer getGoodimg() {
		return this.goodimg;
	}

	/**
	 * 方法: 设置java.lang.Integer
	 * 
	 * @param: java.lang.Integer
	 *             商品头图片
	 */
	public void setGoodimg(java.lang.Integer goodimg) {
		this.goodimg = goodimg;
	}

	public byte[] getGoodimgcode() {
		return goodimgcode;
	}

	public void setGoodimgcode(byte[] goodimgcode) {
		this.goodimgcode = goodimgcode;
	}

	public int getNum() {
		return num;
	}

	public void setNum(int num) {
		this.num = num;
	}

}
